package com.example.tys.baseapplication;

import android.os.Bundle;
import android.os.PersistableBundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import com.example.tys.baseapplication.Mvp.Presenter.BasePresenter;

/**
 * Created by tys on 2017/9/30.
 * mvp架构,资源处理
 */

abstract class BaseActivityMvp<P extends BasePresenter> extends AppCompatActivity{
    protected P presenter;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        presenter = createPresent();
    }

    abstract P createPresent();

    @Override
    protected void onDestroy() {
        presenter.detach();
        super.onDestroy();
    }

}
